# -*- conding:UTF-8 -*-


from takeout.celery import app
from ronglian_sms_sdk import SmsSDK

@app.task
def send_code(mobile,code,expiry=5):
    sdk = SmsSDK(
        accId='8a216da88185a9c001818a77162f013a',
        accToken = 'b8a1fa03b3994e359ee8cea3d7a6eaf3',
        appId = '8a216da88185a9c001818a77175d0141'
    )
    tid = '1'
    mobile = '%s' % mobile
    datas = ('%s' % code,'%s' % expiry)

    res = sdk.sendMessage(tid=tid,mobile=mobile,datas=datas)
    return res